// import { sql } from '@codemirror/lang-sql'
import { languages } from '@codemirror/language-data'

import { colorPicker } from '@replit/codemirror-css-color-picker'

// TODO - when you have time to write a script or something
export const codeMirrorLanguages = {
    'AGS Script': {
        color: '#B9D9FF',
        codeMirrorMode: 'clike',
        extensions: ['*.asc', '*.ash'],
        mimetypes: ['text/x-c++src'],
    },
    'Alpine Abuild': {
        color: null,
        codeMirrorMode: 'shell',
        extensions: [],
        mimetypes: ['text/x-sh'],
    },
    AngelScript: {
        color: '#C7D7DC',
        codeMirrorMode: 'clike',
        extensions: ['*.as', '*.angelscript'],
        mimetypes: ['text/x-c++src'],
    },
    'Ant Build System': {
        color: null,
        codeMirrorMode: 'xml',
        extensions: [],
        mimetypes: ['application/xml'],
    },
    Apex: {
        color: null,
        codeMirrorMode: 'clike',
        extensions: ['*.cls'],
        mimetypes: ['text/x-java'],
    },
    APL: {
        color: '#5A8164',
        codeMirrorMode: 'apl',
        extensions: ['*.apl', '*.dyalog'],
        mimetypes: ['text/apl'],
    },
    'ASN.1': {
        color: null,
        codeMirrorMode: 'asn.1',
        extensions: ['*.asn', '*.asn1'],
        mimetypes: ['text/x-ttcn-asn'],
    },
    ASP: {
        color: '#6a40fd',
        codeMirrorMode: 'htmlembedded',
        extensions: [
            '*.asp',
            '*.asax',
            '*.ascx',
            '*.ashx',
            '*.asmx',
            '*.aspx',
            '*.axd',
        ],
        mimetypes: ['application/x-aspx'],
    },
    Asymptote: {
        color: '#4a0c0c',
        codeMirrorMode: 'clike',
        extensions: ['*.asy'],
        mimetypes: ['text/x-kotlin'],
    },
    Brainfuck: {
        color: '#2F2530',
        codeMirrorMode: 'brainfuck',
        extensions: ['*.b', '*.bf'],
        mimetypes: ['text/x-brainfuck'],
    },
    'C#': {
        color: '#178600',
        codeMirrorMode: 'clike',
        extensions: ['*.cs', '*.cake', '*.csx'],
        mimetypes: ['text/x-csharp'],
    },
    C: {
        color: '#555555',
        codeMirrorMode: 'clike',
        extensions: ['*.c', '*.cats', '*.h', '*.idc'],
        mimetypes: ['text/x-csrc'],
    },
    'C++': {
        color: '#f34b7d',
        codeMirrorMode: 'clike',
        extensions: [
            '*.cpp',
            '*.c++',
            '*.cc',
            '*.cp',
            '*.cxx',
            '*.h',
            '*.h++',
            '*.hh',
            '*.hpp',
            '*.hxx',
            '*.inc',
            '*.inl',
            '*.ino',
            '*.ipp',
            '*.re',
            '*.tcc',
            '*.tpp',
        ],
        mimetypes: ['text/x-c++src'],
    },
    'C2hs Haskell': {
        color: null,
        codeMirrorMode: 'haskell',
        extensions: ['*.chs'],
        mimetypes: ['text/x-haskell'],
    },
    ChucK: {
        color: null,
        codeMirrorMode: 'clike',
        extensions: ['*.ck'],
        mimetypes: ['text/x-java'],
    },
    Clojure: {
        color: '#db5855',
        codeMirrorMode: 'clojure',
        extensions: [
            '*.clj',
            '*.boot',
            '*.cl2',
            '*.cljc',
            '*.cljs',
            '*.cljs.hl',
            '*.cljscm',
            '*.cljx',
            '*.hic',
        ],
        mimetypes: ['text/x-clojure'],
    },
    'Closure Templates': {
        color: null,
        codeMirrorMode: 'soy',
        extensions: ['*.soy'],
        mimetypes: ['text/x-soy'],
    },
    'Cloud Firestore Security Rules': {
        color: null,
        codeMirrorMode: 'css',
        extensions: [],
        mimetypes: ['text/css'],
    },
    CMake: {
        color: null,
        codeMirrorMode: 'cmake',
        extensions: ['*.cmake', '*.cmake.in'],
        mimetypes: ['text/x-cmake'],
    },
    COBOL: {
        color: null,
        codeMirrorMode: 'cobol',
        extensions: ['*.cob', '*.cbl', '*.ccp', '*.cobol', '*.cpy'],
        mimetypes: ['text/x-cobol'],
    },
    CoffeeScript: {
        color: '#244776',
        codeMirrorMode: 'coffeescript',
        extensions: ['*.coffee', '*._coffee', '*.cake', '*.cjsx', '*.iced'],
        mimetypes: ['text/x-coffeescript'],
    },
    COLLADA: {
        color: null,
        codeMirrorMode: 'xml',
        extensions: ['*.dae'],
        mimetypes: ['text/xml'],
    },
    'Common Lisp': {
        color: '#3fb68b',
        codeMirrorMode: 'commonlisp',
        extensions: [
            '*.lisp',
            '*.asd',
            '*.cl',
            '*.l',
            '*.lsp',
            '*.ny',
            '*.podsl',
            '*.sexp',
        ],
        mimetypes: ['text/x-common-lisp'],
    },
    'Common Workflow Language': {
        color: '#B5314C',
        codeMirrorMode: 'yaml',
        extensions: ['*.cwl'],
        mimetypes: ['text/x-yaml'],
    },
    'Component Pascal': {
        color: '#B0CE4E',
        codeMirrorMode: 'pascal',
        extensions: ['*.cp', '*.cps'],
        mimetypes: ['text/x-pascal'],
    },
    Crystal: {
        color: '#000100',
        codeMirrorMode: 'crystal',
        extensions: ['*.cr'],
        mimetypes: ['text/x-crystal'],
    },
    CSON: {
        color: null,
        codeMirrorMode: 'coffeescript',
        extensions: ['*.cson'],
        mimetypes: ['text/x-coffeescript'],
    },
    CSS: {
        color: '#563d7c',
        codeMirrorMode: 'css',
        extensions: ['*.css'],
        mimetypes: ['text/css'],
    },
    Cuda: {
        color: '#3A4E3A',
        codeMirrorMode: 'clike',
        extensions: ['*.cu', '*.cuh'],
        mimetypes: ['text/x-c++src'],
    },
    Cycript: {
        color: null,
        codeMirrorMode: 'javascript',
        extensions: ['*.cy'],
        mimetypes: ['text/javascript'],
    },
    Cython: {
        color: null,
        codeMirrorMode: 'python',
        extensions: ['*.pyx', '*.pxd', '*.pxi'],
        mimetypes: ['text/x-cython'],
    },
    D: {
        color: '#ba595e',
        codeMirrorMode: 'd',
        extensions: ['*.d', '*.di'],
        mimetypes: ['text/x-d'],
    },
    // 'Dart': { color: '#00B4AB', codeMirrorMode: 'dart', extensions: ['*.dart'], mimetypes: ['application/dart'] },
    Diff: {
        color: null,
        codeMirrorMode: 'diff',
        extensions: ['*.diff', '*.patch'],
        mimetypes: ['text/x-diff'],
    },
    Dockerfile: {
        color: '#384d54',
        codeMirrorMode: 'dockerfile',
        extensions: ['*.dockerfile'],
        mimetypes: ['text/x-dockerfile'],
    },
    DTrace: {
        color: null,
        codeMirrorMode: 'clike',
        extensions: ['*.d'],
        mimetypes: ['text/x-csrc'],
    },
    Dylan: {
        color: '#6c616e',
        codeMirrorMode: 'dylan',
        extensions: ['*.dylan', '*.dyl', '*.intr', '*.lid'],
        mimetypes: ['text/x-dylan'],
    },
    Eagle: {
        color: null,
        codeMirrorMode: 'xml',
        extensions: ['*.sch', '*.brd'],
        mimetypes: ['text/xml'],
    },
    Easybuild: {
        color: null,
        codeMirrorMode: 'python',
        extensions: ['*.eb'],
        mimetypes: ['text/x-python'],
    },
    EBNF: {
        color: null,
        codeMirrorMode: 'ebnf',
        extensions: ['*.ebnf'],
        mimetypes: ['text/x-ebnf'],
    },
    'Ecere Projects': {
        color: null,
        codeMirrorMode: 'javascript',
        extensions: ['*.epj'],
        mimetypes: ['application/json'],
    },
    ECL: {
        color: '#8a1267',
        codeMirrorMode: 'ecl',
        extensions: ['*.ecl', '*.eclxml'],
        mimetypes: ['text/x-ecl'],
    },
    'Edje Data Collection': {
        color: null,
        codeMirrorMode: 'javascript',
        extensions: ['*.edc'],
        mimetypes: ['application/json'],
    },
    edn: {
        color: null,
        codeMirrorMode: 'clojure',
        extensions: ['*.edn'],
        mimetypes: ['text/x-clojure'],
    },
    Eiffel: {
        color: '#946d57',
        codeMirrorMode: 'eiffel',
        extensions: ['*.e'],
        mimetypes: ['text/x-eiffel'],
    },
    Elm: {
        color: '#60B5CC',
        codeMirrorMode: 'elm',
        extensions: ['*.elm'],
        mimetypes: ['text/x-elm'],
    },
    'Emacs Lisp': {
        color: '#c065db',
        codeMirrorMode: 'commonlisp',
        extensions: ['*.el', '*.emacs', '*.emacs.desktop'],
        mimetypes: ['text/x-common-lisp'],
    },
    EmberScript: {
        color: '#FFF4F3',
        codeMirrorMode: 'coffeescript',
        extensions: ['*.em', '*.emberscript'],
        mimetypes: ['text/x-coffeescript'],
    },
    EQ: {
        color: '#a78649',
        codeMirrorMode: 'clike',
        extensions: ['*.eq'],
        mimetypes: ['text/x-csharp'],
    },
    Erlang: {
        color: '#B83998',
        codeMirrorMode: 'erlang',
        extensions: [
            '*.erl',
            '*.app.src',
            '*.es',
            '*.escript',
            '*.hrl',
            '*.xrl',
            '*.yrl',
        ],
        mimetypes: ['text/x-erlang'],
    },
    'F#': {
        color: '#b845fc',
        codeMirrorMode: 'mllike',
        extensions: ['*.fs', '*.fsi', '*.fsx'],
        mimetypes: ['text/x-fsharp'],
    },
    Factor: {
        color: '#636746',
        codeMirrorMode: 'factor',
        extensions: ['*.factor'],
        mimetypes: ['text/x-factor'],
    },
    Forth: {
        color: '#341708',
        codeMirrorMode: 'forth',
        extensions: [
            '*.fth',
            '*.4th',
            '*.f',
            '*.for',
            '*.forth',
            '*.fr',
            '*.frt',
            '*.fs',
        ],
        mimetypes: ['text/x-forth'],
    },
    Fortran: {
        color: '#4d41b1',
        codeMirrorMode: 'fortran',
        extensions: [
            '*.f90',
            '*.f',
            '*.f03',
            '*.f08',
            '*.f77',
            '*.f95',
            '*.for',
            '*.fpp',
        ],
        mimetypes: ['text/x-fortran'],
    },
    'Game Maker Language': {
        color: '#71b417',
        codeMirrorMode: 'clike',
        extensions: ['*.gml'],
        mimetypes: ['text/x-c++src'],
    },
    'GCC Machine Description': {
        color: null,
        codeMirrorMode: 'commonlisp',
        extensions: ['*.md'],
        mimetypes: ['text/x-common-lisp'],
    },
    Genshi: {
        color: null,
        codeMirrorMode: 'xml',
        extensions: ['*.kid'],
        mimetypes: ['text/xml'],
    },
    'Gentoo Ebuild': {
        color: null,
        codeMirrorMode: 'shell',
        extensions: ['*.ebuild'],
        mimetypes: ['text/x-sh'],
    },
    'Gentoo Eclass': {
        color: null,
        codeMirrorMode: 'shell',
        extensions: ['*.eclass'],
        mimetypes: ['text/x-sh'],
    },
    'Git Attributes': {
        color: null,
        codeMirrorMode: 'shell',
        extensions: [],
        mimetypes: ['text/x-sh'],
    },
    'Git Config': {
        color: null,
        codeMirrorMode: 'properties',
        extensions: ['*.gitconfig'],
        mimetypes: ['text/x-properties'],
    },
    Glyph: {
        color: '#c1ac7f',
        codeMirrorMode: 'tcl',
        extensions: ['*.glf'],
        mimetypes: ['text/x-tcl'],
    },
    GN: {
        color: null,
        codeMirrorMode: 'python',
        extensions: ['*.gn', '*.gni'],
        mimetypes: ['text/x-python'],
    },
    Go: {
        color: '#00ADD8',
        codeMirrorMode: 'go',
        extensions: ['*.go'],
        mimetypes: ['text/x-go'],
    },
    'Grammatical Framework': {
        color: '#79aa7a',
        codeMirrorMode: 'haskell',
        extensions: ['*.gf'],
        mimetypes: ['text/x-haskell'],
    },
    'Groovy Server Pages': {
        color: null,
        codeMirrorMode: 'htmlembedded',
        extensions: ['*.gsp'],
        mimetypes: ['application/x-jsp'],
    },
    Groovy: {
        color: '#e69f56',
        codeMirrorMode: 'groovy',
        extensions: ['*.groovy', '*.grt', '*.gtpl', '*.gvy'],
        mimetypes: ['text/x-groovy'],
    },
    Hack: {
        color: '#878787',
        codeMirrorMode: 'php',
        extensions: ['*.hh', '*.php'],
        mimetypes: ['application/x-httpd-php'],
    },
    Haml: {
        color: null,
        codeMirrorMode: 'haml',
        extensions: ['*.haml', '*.haml.deface'],
        mimetypes: ['text/x-haml'],
    },
    Haskell: {
        color: '#5e5086',
        codeMirrorMode: 'haskell',
        extensions: ['*.hs', '*.hsc'],
        mimetypes: ['text/x-haskell'],
    },
    Haxe: {
        color: '#df7900',
        codeMirrorMode: 'haxe',
        extensions: ['*.hx', '*.hxsl'],
        mimetypes: ['text/x-haxe'],
    },
    HCL: {
        color: null,
        codeMirrorMode: 'ruby',
        extensions: ['*.hcl', '*.tf', '*.tfvars', '*.workflow'],
        mimetypes: ['text/x-ruby'],
    },
    HTML: {
        color: '#e34c26',
        codeMirrorMode: 'htmlmixed',
        extensions: [
            '*.html',
            '*.htm',
            '*.html.hl',
            '*.inc',
            '*.st',
            '*.xht',
            '*.xhtml',
        ],
        mimetypes: ['text/html'],
    },
    'HTML+Django': {
        color: null,
        codeMirrorMode: 'django',
        extensions: ['*.jinja', '*.jinja2', '*.mustache', '*.njk'],
        mimetypes: ['text/x-django'],
    },
    'HTML+ECR': {
        color: null,
        codeMirrorMode: 'htmlmixed',
        extensions: ['*.ecr'],
        mimetypes: ['text/html'],
    },
    'HTML+EEX': {
        color: null,
        codeMirrorMode: 'htmlmixed',
        extensions: ['*.eex'],
        mimetypes: ['text/html'],
    },
    'HTML+ERB': {
        color: null,
        codeMirrorMode: 'htmlembedded',
        extensions: ['*.erb', '*.erb.deface'],
        mimetypes: ['application/x-erb'],
    },
    'HTML+PHP': {
        color: null,
        codeMirrorMode: 'php',
        extensions: ['*.phtml'],
        mimetypes: ['application/x-httpd-php'],
    },
    'HTML+Razor': {
        color: null,
        codeMirrorMode: 'htmlmixed',
        extensions: ['*.cshtml'],
        mimetypes: ['text/html'],
    },
    HTTP: {
        color: null,
        codeMirrorMode: 'http',
        extensions: ['*.http'],
        mimetypes: ['message/http'],
    },
    IDL: {
        color: '#a3522f',
        codeMirrorMode: 'idl',
        extensions: ['*.pro', '*.dlm'],
        mimetypes: ['text/x-idl'],
    },
    'Ignore List': {
        color: null,
        codeMirrorMode: 'shell',
        extensions: ['*.gitignore'],
        mimetypes: ['text/x-sh'],
    },
    INI: {
        color: null,
        codeMirrorMode: 'properties',
        extensions: [
            '*.ini',
            '*.cfg',
            '*.lektorproject',
            '*.prefs',
            '*.pro',
            '*.properties',
        ],
        mimetypes: ['text/x-properties'],
    },
    'IRC log': {
        color: null,
        codeMirrorMode: 'mirc',
        extensions: ['*.irclog', '*.weechatlog'],
        mimetypes: ['text/mirc'],
    },
    'Java Properties': {
        color: null,
        codeMirrorMode: 'properties',
        extensions: ['*.properties'],
        mimetypes: ['text/x-properties'],
    },
    'Java Server Pages': {
        color: null,
        codeMirrorMode: 'htmlembedded',
        extensions: ['*.jsp'],
        mimetypes: ['application/x-jsp'],
    },
    Java: {
        color: '#b07219',
        codeMirrorMode: 'clike',
        extensions: ['*.java'],
        mimetypes: ['text/x-java'],
    },
    JavaScript: {
        color: '#f1e05a',
        codeMirrorMode: 'javascript',
        extensions: [
            '*.js',
            '*._js',
            '*.bones',
            '*.es',
            '*.es6',
            '*.frag',
            '*.gs',
            '*.jake',
            '*.jsb',
            '*.jscad',
            '*.jsfl',
            '*.jsm',
            '*.jss',
            '*.mjs',
            '*.njs',
            '*.pa',
            ' *.sjs',
            '*.ssjs',
            '*.xsjs',
            '*.xsjslib',
        ],
        mimetypes: ['text/javascript'],
    },
    'JSON with Comments': {
        color: null,
        codeMirrorMode: 'javascript',
        extensions: [
            '*.sublime-build',
            '*.sublime-commands',
            '*.sublime-completions',
            '*.sublime-keymap',
            '*.sublime-macro',
            '*.sublime-menu',
            '*.sublime-mousema',
            ' *.sublime-project',
            '*.sublime-settings',
            '*.sublime-theme',
            '*.sublime-workspace',
            '*.sublime_metrics',
            '*.sublime_session',
        ],
        mimetypes: ['text/javascript'],
    },
    JSON: {
        color: null,
        codeMirrorMode: 'javascript',
        extensions: [
            '*.json',
            '*.avsc',
            '*.geojson',
            '*.gltf',
            '*.har',
            '*.ice',
            '*.JSON-tmLanguage',
            '*.jsonl',
            '*.tfstate',
            '*.tfstate.backup',
            '*.topojso',
            '*.webapp',
            '*.webmanifest',
            '*.yy',
            '*.yyp',
        ],
        mimetypes: ['application/json'],
    },
    JSON5: {
        color: null,
        codeMirrorMode: 'javascript',
        extensions: ['*.json5'],
        mimetypes: ['application/json'],
    },
    JSONiq: {
        color: '#40d47e',
        codeMirrorMode: 'javascript',
        extensions: ['*.jq'],
        mimetypes: ['application/json'],
    },
    JSONLD: {
        color: null,
        codeMirrorMode: 'javascript',
        extensions: ['*.jsonld'],
        mimetypes: ['application/json'],
    },
    JSX: {
        color: null,
        codeMirrorMode: 'jsx',
        extensions: ['*.jsx'],
        mimetypes: ['text/jsx'],
    },
    Julia: {
        color: '#a270ba',
        codeMirrorMode: 'julia',
        extensions: ['*.jl'],
        mimetypes: ['text/x-julia'],
    },
    'Jupyter Notebook': {
        color: '#DA5B0B',
        codeMirrorMode: 'javascript',
        extensions: ['*.ipynb'],
        mimetypes: ['application/json'],
    },
    'KiCad Layout': {
        color: null,
        codeMirrorMode: 'commonlisp',
        extensions: ['*.kicad_pcb', '*.kicad_mod', '*.kicad_wks'],
        mimetypes: ['text/x-common-lisp'],
    },
    Kit: {
        color: null,
        codeMirrorMode: 'htmlmixed',
        extensions: ['*.kit'],
        mimetypes: ['text/html'],
    },
    Kotlin: {
        color: '#F18E33',
        codeMirrorMode: 'clike',
        extensions: ['*.kt', '*.ktm', '*.kts'],
        mimetypes: ['text/x-kotlin'],
    },
    LabVIEW: {
        color: null,
        codeMirrorMode: 'xml',
        extensions: ['*.lvproj'],
        mimetypes: ['text/xml'],
    },
    Latte: {
        color: null,
        codeMirrorMode: 'smarty',
        extensions: ['*.latte'],
        mimetypes: ['text/x-smarty'],
    },
    Less: {
        color: null,
        codeMirrorMode: 'css',
        extensions: ['*.less'],
        mimetypes: ['text/css'],
    },
    LFE: {
        color: '#4C3023',
        codeMirrorMode: 'commonlisp',
        extensions: ['*.lfe'],
        mimetypes: ['text/x-common-lisp'],
    },
    'Literate Haskell': {
        color: null,
        codeMirrorMode: 'haskell-literate',
        extensions: ['*.lhs'],
        mimetypes: ['text/x-literate-haskell'],
    },
    LiveScript: {
        color: '#499886',
        codeMirrorMode: 'livescript',
        extensions: ['*.ls', '*._ls'],
        mimetypes: ['text/x-livescript'],
    },
    LookML: {
        color: '#652B81',
        codeMirrorMode: 'yaml',
        extensions: ['*.lookml', '*.model.lkml', '*.view.lkml'],
        mimetypes: ['text/x-yaml'],
    },
    'LTspice Symbol': {
        color: null,
        codeMirrorMode: 'spreadsheet',
        extensions: ['*.asy'],
        mimetypes: ['text/x-spreadsheet'],
    },
    Lua: {
        color: '#000080',
        codeMirrorMode: 'lua',
        extensions: [
            '*.lua',
            '*.fcgi',
            '*.nse',
            '*.p8',
            '*.pd_lua',
            '*.rbxs',
            '*.wlua',
        ],
        mimetypes: ['text/x-lua'],
    },
    M: {
        color: null,
        codeMirrorMode: 'mumps',
        extensions: ['*.mumps', '*.m'],
        mimetypes: ['text/x-mumps'],
    },
    Makefile: {
        color: '#427819',
        codeMirrorMode: 'cmake',
        extensions: ['*.mak', '*.d', '*.make', '*.mk', '*.mkfile'],
        mimetypes: ['text/x-cmake'],
    },
    Markdown: {
        color: null,
        codeMirrorMode: 'gfm',
        extensions: [
            '*.md',
            '*.markdown',
            '*.mdown',
            '*.mdwn',
            '*.mkd',
            '*.mkdn',
            '*.mkdown',
            '*.ronn',
            '*.workbook',
        ],
        mimetypes: ['text/x-gfm'],
    },
    Marko: {
        color: null,
        codeMirrorMode: 'htmlmixed',
        extensions: ['*.marko'],
        mimetypes: ['text/html'],
    },
    Mathematica: {
        color: null,
        codeMirrorMode: 'mathematica',
        extensions: [
            '*.mathematica',
            '*.cdf',
            '*.m',
            '*.ma',
            '*.mt',
            '*.nb',
            '*.nbp',
            '*.wl',
            '*.wlt',
        ],
        mimetypes: ['text/x-mathematica'],
    },
    MATLAB: {
        color: '#e16737',
        codeMirrorMode: 'octave',
        extensions: ['*.matlab', '*.m'],
        mimetypes: ['text/x-octave'],
    },
    'Maven POM': {
        color: null,
        codeMirrorMode: 'xml',
        extensions: [],
        mimetypes: ['text/xml'],
    },
    Max: {
        color: '#c4a79c',
        codeMirrorMode: 'javascript',
        extensions: ['*.maxpat', '*.maxhelp', '*.maxproj', '*.mxt', '*.pat'],
        mimetypes: ['application/json'],
    },
    Metal: {
        color: '#8f14e9',
        codeMirrorMode: 'clike',
        extensions: ['*.metal'],
        mimetypes: ['text/x-c++src'],
    },
    Mirah: {
        color: '#c7a938',
        codeMirrorMode: 'ruby',
        extensions: ['*.druby', '*.duby', '*.mirah'],
        mimetypes: ['text/x-ruby'],
    },
    Modelica: {
        color: null,
        codeMirrorMode: 'modelica',
        extensions: ['*.mo'],
        mimetypes: ['text/x-modelica'],
    },
    MTML: {
        color: '#b7e1f4',
        codeMirrorMode: 'htmlmixed',
        extensions: ['*.mtml'],
        mimetypes: ['text/html'],
    },
    MUF: {
        color: null,
        codeMirrorMode: 'forth',
        extensions: ['*.muf', '*.m'],
        mimetypes: ['text/x-forth'],
    },
    NetLogo: {
        color: '#ff6375',
        codeMirrorMode: 'commonlisp',
        extensions: ['*.nlogo'],
        mimetypes: ['text/x-common-lisp'],
    },
    NewLisp: {
        color: '#87AED7',
        codeMirrorMode: 'commonlisp',
        extensions: ['*.nl', '*.lisp', '*.lsp'],
        mimetypes: ['text/x-common-lisp'],
    },
    Nginx: {
        color: null,
        codeMirrorMode: 'nginx',
        extensions: ['*.nginxconf', '*.vhost'],
        mimetypes: ['text/x-nginx-conf'],
    },
    NSIS: {
        color: null,
        codeMirrorMode: 'nsis',
        extensions: ['*.nsi', '*.nsh'],
        mimetypes: ['text/x-nsis'],
    },
    Nu: {
        color: '#c9df40',
        codeMirrorMode: 'scheme',
        extensions: ['*.nu'],
        mimetypes: ['text/x-scheme'],
    },
    NumPy: {
        color: null,
        codeMirrorMode: 'python',
        extensions: ['*.numpy', '*.numpyw', '*.numsc'],
        mimetypes: ['text/x-python'],
    },
    'Objective-C': {
        color: '#438eff',
        codeMirrorMode: 'clike',
        extensions: ['*.m', '*.h'],
        mimetypes: ['text/x-objectivec'],
    },
    'Objective-C++': {
        color: '#6866fb',
        codeMirrorMode: 'clike',
        extensions: ['*.mm'],
        mimetypes: ['text/x-objectivec'],
    },
    OCaml: {
        color: '#3be133',
        codeMirrorMode: 'mllike',
        extensions: [
            '*.ml',
            '*.eliom',
            '*.eliomi',
            '*.ml4',
            '*.mli',
            '*.mll',
            '*.mly',
        ],
        mimetypes: ['text/x-ocaml'],
    },
    OpenCL: {
        color: null,
        codeMirrorMode: 'clike',
        extensions: ['*.cl', '*.opencl'],
        mimetypes: ['text/x-csrc'],
    },
    'OpenRC runscript': {
        color: null,
        codeMirrorMode: 'shell',
        extensions: [],
        mimetypes: ['text/x-sh'],
    },
    Oz: {
        color: '#fab738',
        codeMirrorMode: 'oz',
        extensions: ['*.oz'],
        mimetypes: ['text/x-oz'],
    },
    Pascal: {
        color: '#E3F171',
        codeMirrorMode: 'pascal',
        extensions: [
            '*.pas',
            '*.dfm',
            '*.dpr',
            '*.inc',
            '*.lpr',
            '*.pascal',
            '*.pp',
        ],
        mimetypes: ['text/x-pascal'],
    },
    'Perl 6': {
        color: '#0000fb',
        codeMirrorMode: 'perl',
        extensions: [
            '*.6pl',
            '*.6pm',
            '*.nqp',
            '*.p6',
            '*.p6l',
            '*.p6m',
            '*.pl',
            '*.pl6',
            '*.pm',
            '*.pm6',
            '*.t',
        ],
        mimetypes: ['text/x-perl'],
    },
    Perl: {
        color: '#0298c3',
        codeMirrorMode: 'perl',
        extensions: [
            '*.pl',
            '*.al',
            '*.cgi',
            '*.fcgi',
            '*.perl',
            '*.ph',
            '*.plx',
            '*.pm',
            '*.psgi',
            '*.t',
        ],
        mimetypes: ['text/x-perl'],
    },
    PHP: {
        color: '#4F5D95',
        codeMirrorMode: 'php',
        extensions: [
            '*.php',
            '*.aw',
            '*.ctp',
            '*.fcgi',
            '*.inc',
            '*.php3',
            '*.php4',
            '*.php5',
            '*.phps',
            '*.phpt',
        ],
        mimetypes: ['application/x-httpd-php'],
    },
    Pic: {
        color: null,
        codeMirrorMode: 'troff',
        extensions: ['*.pic', '*.chem'],
        mimetypes: ['text/troff'],
    },
    PLpgSQL: {
        color: null,
        codeMirrorMode: 'sql',
        extensions: ['*.pgsql', '*.sql'],
        mimetypes: ['text/x-sql'],
    },
    PLSQL: {
        color: '#dad8d8',
        codeMirrorMode: 'sql',
        extensions: [
            '*.pls',
            '*.bdy',
            '*.ddl',
            '*.fnc',
            '*.pck',
            '*.pkb',
            '*.pks',
            '*.plb',
            '*.plsql',
            '*.prc',
            '*.spc',
            '*.sql',
            '*.tpb',
            '*.tps',
            '*.trg',
            '*.vw',
        ],
        mimetypes: ['text/x-plsql'],
    },
    Pod: {
        color: null,
        codeMirrorMode: 'perl',
        extensions: ['*.pod'],
        mimetypes: ['text/x-perl'],
    },
    PowerShell: {
        color: '#012456',
        codeMirrorMode: 'powershell',
        extensions: ['*.ps1', '*.psd1', '*.psm1'],
        mimetypes: ['application/x-powershell'],
    },
    'Protocol Buffer': {
        color: null,
        codeMirrorMode: 'protobuf',
        extensions: ['*.proto'],
        mimetypes: ['text/x-protobuf'],
    },
    'Public Key': {
        color: null,
        codeMirrorMode: 'asciiarmor',
        extensions: ['*.asc', '*.pub'],
        mimetypes: ['application/pgp'],
    },
    Pug: {
        color: null,
        codeMirrorMode: 'pug',
        extensions: ['*.jade', '*.pug'],
        mimetypes: ['text/x-pug'],
    },
    Puppet: {
        color: '#302B6D',
        codeMirrorMode: 'puppet',
        extensions: ['*.pp'],
        mimetypes: ['text/x-puppet'],
    },
    PureScript: {
        color: '#1D222D',
        codeMirrorMode: 'haskell',
        extensions: ['*.purs'],
        mimetypes: ['text/x-haskell'],
    },
    Python: {
        color: '#3572A5',
        codeMirrorMode: 'python',
        extensions: [
            '*.py',
            '*.bzl',
            '*.cgi',
            '*.fcgi',
            '*.gyp',
            '*.gypi',
            '*.lmi',
            '*.py3',
            '*.pyde',
            '*.pyi',
            '*.pyp',
            '*.pyt',
            '*.pyw',
            '*.rpy',
            '*.spec',
            '*.ta',
            ' *.wsgi',
            '*.xpy',
        ],
        mimetypes: ['text/x-python'],
    },
    R: {
        color: '#198CE7',
        codeMirrorMode: 'r',
        extensions: ['*.r', '*.rd', '*.rsx'],
        mimetypes: ['text/x-rsrc'],
    },
    RAML: {
        color: '#77d9fb',
        codeMirrorMode: 'yaml',
        extensions: ['*.raml'],
        mimetypes: ['text/x-yaml'],
    },
    Reason: {
        color: null,
        codeMirrorMode: 'rust',
        extensions: ['*.re', '*.rei'],
        mimetypes: ['text/x-rustsrc'],
    },
    reStructuredText: {
        color: null,
        codeMirrorMode: 'rst',
        extensions: ['*.rst', '*.rest', '*.rest.txt', '*.rst.txt'],
        mimetypes: ['text/x-rst'],
    },
    RHTML: {
        color: null,
        codeMirrorMode: 'htmlembedded',
        extensions: ['*.rhtml'],
        mimetypes: ['application/x-erb'],
    },
    RMarkdown: {
        color: null,
        codeMirrorMode: 'gfm',
        extensions: ['*.rmd'],
        mimetypes: ['text/x-gfm'],
    },
    'Roff Manpage': {
        color: null,
        codeMirrorMode: 'troff',
        extensions: [
            '*.1',
            '*.1in',
            '*.1m',
            '*.1x',
            '*.2',
            '*.3',
            '*.3in',
            '*.3m',
            '*.3p',
            '*.3pm',
            '*.3qt',
            '*.3x',
            '*.4',
            '*.5',
            '*.6',
            '*.7',
            '*.8',
            '*.9',
            '*.man',
            '*.mdoc',
        ],
        mimetypes: ['text/troff'],
    },
    Roff: {
        color: '#ecdebe',
        codeMirrorMode: 'troff',
        extensions: [
            '*.roff',
            '*.1',
            '*.1in',
            '*.1m',
            '*.1x',
            '*.2',
            '*.3',
            '*.3in',
            '*.3m',
            '*.3p',
            '*.3pm',
            '*.3qt',
            '*.3x',
            '*.4',
            '*.5',
            '*.6',
            '*.7',
            '*.8',
            '*.',
            '*.l',
            '*.man',
            '*.mdoc',
            '*.me',
            '*.ms',
            '*.n',
            '*.nr',
            '*.rno',
            '*.tmac',
        ],
        mimetypes: ['text/troff'],
    },
    Rouge: {
        color: '#cc0088',
        codeMirrorMode: 'clojure',
        extensions: ['*.rg'],
        mimetypes: ['text/x-clojure'],
    },
    'RPM Spec': {
        color: null,
        codeMirrorMode: 'rpm',
        extensions: ['*.spec'],
        mimetypes: ['text/x-rpm-spec'],
    },
    Ruby: {
        color: '#701516',
        codeMirrorMode: 'ruby',
        extensions: [
            '*.rb',
            '*.builder',
            '*.eye',
            '*.fcgi',
            '*.gemspec',
            '*.god',
            '*.jbuilder',
            '*.mspec',
            '*.pluginspec',
            '*.podspec',
            '*.rabl',
            '*.rake',
            '*.rbuil',
            ' *.rbw',
            '*.rbx',
            '*.ru',
            '*.ruby',
            '*.spec',
            '*.thor',
            '*.watchr',
        ],
        mimetypes: ['text/x-ruby'],
    },
    Rust: {
        color: '#dea584',
        codeMirrorMode: 'rust',
        extensions: ['*.rs', '*.rs.in'],
        mimetypes: ['text/x-rustsrc'],
    },
    Sage: {
        color: null,
        codeMirrorMode: 'python',
        extensions: ['*.sage', '*.sagews'],
        mimetypes: ['text/x-python'],
    },
    SaltStack: {
        color: '#646464',
        codeMirrorMode: 'yaml',
        extensions: ['*.sls'],
        mimetypes: ['text/x-yaml'],
    },
    SAS: {
        color: '#B34936',
        codeMirrorMode: 'sas',
        extensions: ['*.sas'],
        mimetypes: ['text/x-sas'],
    },
    Sass: {
        color: null,
        codeMirrorMode: 'sass',
        extensions: ['*.sass'],
        mimetypes: ['text/x-sass'],
    },
    Scala: {
        color: '#c22d40',
        codeMirrorMode: 'clike',
        extensions: ['*.scala', '*.kojo', '*.sbt', '*.sc'],
        mimetypes: ['text/x-scala'],
    },
    Scheme: {
        color: '#1e4aec',
        codeMirrorMode: 'scheme',
        extensions: ['*.scm', '*.sch', '*.sld', '*.sls', '*.sps', '*.ss'],
        mimetypes: ['text/x-scheme'],
    },
    SCSS: {
        color: null,
        codeMirrorMode: 'css',
        extensions: ['*.scss'],
        mimetypes: ['text/x-scss'],
    },
    Shell: {
        color: '#89e051',
        codeMirrorMode: 'shell',
        extensions: [
            '*.sh',
            '*.bash',
            '*.bats',
            '*.cgi',
            '*.command',
            '*.fcgi',
            '*.ksh',
            '*.sh.in',
            '*.tmux',
            '*.tool',
            '*.zsh',
        ],
        mimetypes: ['text/x-sh'],
    },
    ShellSession: {
        color: null,
        codeMirrorMode: 'shell',
        extensions: ['*.sh-session'],
        mimetypes: ['text/x-sh'],
    },
    Slim: {
        color: null,
        codeMirrorMode: 'slim',
        extensions: ['*.slim'],
        mimetypes: ['text/x-slim'],
    },
    Smalltalk: {
        color: '#596706',
        codeMirrorMode: 'smalltalk',
        extensions: ['*.st', '*.cs'],
        mimetypes: ['text/x-stsrc'],
    },
    Smarty: {
        color: null,
        codeMirrorMode: 'smarty',
        extensions: ['*.tpl'],
        mimetypes: ['text/x-smarty'],
    },
    SPARQL: {
        color: null,
        codeMirrorMode: 'sparql',
        extensions: ['*.sparql', '*.rq'],
        mimetypes: ['application/sparql-query'],
    },
    SQL: {
        color: null,
        codeMirrorMode: 'sql',
        extensions: [
            '*.sql',
            '*.cql',
            '*.ddl',
            '*.inc',
            '*.mysql',
            '*.prc',
            '*.tab',
            '*.udf',
            '*.viw',
        ],
        mimetypes: ['text/x-sql'],
    },
    SQLPL: {
        color: null,
        codeMirrorMode: 'sql',
        extensions: ['*.sql', '*.db2'],
        mimetypes: ['text/x-sql'],
    },
    Squirrel: {
        color: '#800000',
        codeMirrorMode: 'clike',
        extensions: ['*.nut'],
        mimetypes: ['text/x-c++src'],
    },
    'SRecode Template': {
        color: '#348a34',
        codeMirrorMode: 'commonlisp',
        extensions: ['*.srt'],
        mimetypes: ['text/x-common-lisp'],
    },
    'Standard ML': {
        color: '#dc566d',
        codeMirrorMode: 'mllike',
        extensions: ['*.ML', '*.fun', '*.sig', '*.sml'],
        mimetypes: ['text/x-ocaml'],
    },
    SVG: {
        color: null,
        codeMirrorMode: 'xml',
        extensions: ['*.svg'],
        mimetypes: ['text/xml'],
    },
    Swift: {
        color: '#ffac45',
        codeMirrorMode: 'swift',
        extensions: ['*.swift'],
        mimetypes: ['text/x-swift'],
    },
    SystemVerilog: {
        color: '#DAE1C2',
        codeMirrorMode: 'verilog',
        extensions: ['*.sv', '*.svh', '*.vh'],
        mimetypes: ['text/x-systemverilog'],
    },
    Tcl: {
        color: '#e4cc98',
        codeMirrorMode: 'tcl',
        extensions: ['*.tcl', '*.adp', '*.tm'],
        mimetypes: ['text/x-tcl'],
    },
    Tcsh: {
        color: null,
        codeMirrorMode: 'shell',
        extensions: ['*.tcsh', '*.csh'],
        mimetypes: ['text/x-sh'],
    },
    Terra: {
        color: '#00004c',
        codeMirrorMode: 'lua',
        extensions: ['*.t'],
        mimetypes: ['text/x-lua'],
    },
    TeX: {
        color: '#3D6117',
        codeMirrorMode: 'stex',
        extensions: [
            '*.tex',
            '*.aux',
            '*.bbx',
            '*.bib',
            '*.cbx',
            '*.cls',
            '*.dtx',
            '*.ins',
            '*.lbx',
            '*.ltx',
            '*.mkii',
            '*.mkiv',
            '*.mkvi',
            '*.sty',
            '*.toc',
        ],
        mimetypes: ['text/x-stex'],
    },
    Textile: {
        color: null,
        codeMirrorMode: 'textile',
        extensions: ['*.textile'],
        mimetypes: ['text/x-textile'],
    },
    TOML: {
        color: null,
        codeMirrorMode: 'toml',
        extensions: ['*.toml'],
        mimetypes: ['text/x-toml'],
    },
    Turtle: {
        color: null,
        codeMirrorMode: 'turtle',
        extensions: ['*.ttl'],
        mimetypes: ['text/turtle'],
    },
    Twig: {
        color: null,
        codeMirrorMode: 'twig',
        extensions: ['*.twig'],
        mimetypes: ['text/x-twig'],
    },
    TypeScript: {
        color: '#2b7489',
        codeMirrorMode: 'javascript',
        extensions: ['*.ts', '*.tsx'],
        mimetypes: ['application/typescript'],
    },
    'Unified Parallel C': {
        color: null,
        codeMirrorMode: 'clike',
        extensions: ['*.upc'],
        mimetypes: ['text/x-csrc'],
    },
    'Unity3D Asset': {
        color: null,
        codeMirrorMode: 'yaml',
        extensions: [
            '*.anim',
            '*.asset',
            '*.mat',
            '*.meta',
            '*.prefab',
            '*.unity',
        ],
        mimetypes: ['text/x-yaml'],
    },
    Uno: {
        color: null,
        codeMirrorMode: 'clike',
        extensions: ['*.uno'],
        mimetypes: ['text/x-csharp'],
    },
    UnrealScript: {
        color: '#a54c4d',
        codeMirrorMode: 'clike',
        extensions: ['*.uc'],
        mimetypes: ['text/x-java'],
    },
    Verilog: {
        color: '#b2b7f8',
        codeMirrorMode: 'verilog',
        extensions: ['*.v', '*.veo'],
        mimetypes: ['text/x-verilog'],
    },
    VHDL: {
        color: '#adb2cb',
        codeMirrorMode: 'vhdl',
        extensions: [
            '*.vhdl',
            '*.vhd',
            '*.vhf',
            '*.vhi',
            '*.vho',
            '*.vhs',
            '*.vht',
            '*.vhw',
        ],
        mimetypes: ['text/x-vhdl'],
    },
    'Visual Basic': {
        color: '#945db7',
        codeMirrorMode: 'vb',
        extensions: [
            '*.vb',
            '*.bas',
            '*.cls',
            '*.frm',
            '*.frx',
            '*.vba',
            '*.vbhtml',
            '*.vbs',
        ],
        mimetypes: ['text/x-vb'],
    },
    Volt: {
        color: '#1F1F1F',
        codeMirrorMode: 'd',
        extensions: ['*.volt'],
        mimetypes: ['text/x-d'],
    },
    WebAssembly: {
        color: '#04133b',
        codeMirrorMode: 'commonlisp',
        extensions: ['*.wast', '*.wat'],
        mimetypes: ['text/x-common-lisp'],
    },
    WebIDL: {
        color: null,
        codeMirrorMode: 'webidl',
        extensions: ['*.webidl'],
        mimetypes: ['text/x-webidl'],
    },
    'Windows Registry Entries': {
        color: null,
        codeMirrorMode: 'properties',
        extensions: ['*.reg'],
        mimetypes: ['text/x-properties'],
    },
    wisp: {
        color: '#7582D1',
        codeMirrorMode: 'clojure',
        extensions: ['*.wisp'],
        mimetypes: ['text/x-clojure'],
    },
    'X BitMap': {
        color: null,
        codeMirrorMode: 'clike',
        extensions: ['*.xbm'],
        mimetypes: ['text/x-csrc'],
    },
    'X PixMap': {
        color: null,
        codeMirrorMode: 'clike',
        extensions: ['*.xpm', '*.pm'],
        mimetypes: ['text/x-csrc'],
    },
    XC: {
        color: '#99DA07',
        codeMirrorMode: 'clike',
        extensions: ['*.xc'],
        mimetypes: ['text/x-csrc'],
    },
    XML: {
        color: null,
        codeMirrorMode: 'xml',
        extensions: [
            '*.xml',
            '*.adml',
            '*.admx',
            '*.ant',
            '*.axml',
            '*.builds',
            '*.ccproj',
            '*.ccxml',
            '*.clixml',
            '*.cproject',
            '*.cscfg',
            '*.csdef',
            '*.cs',
            '*.csproj',
            '*.ct',
            '*.depproj',
            '*.dita',
            '*.ditamap',
            '*.ditaval',
            '*.dll.config',
            '*.dotsettings',
            '*.filters',
            '*.fsproj',
            '*.fxml',
            '*.glad',
            '*.gml',
            '*.gmx',
            '*.grxml',
            '*.iml',
            '*.ivy',
            '*.jelly',
            '*.jsproj',
            '*.kml',
            '*.launch',
            '*.mdpolicy',
            '*.mjml',
            '*.mm',
            '*.mod',
            '*.mxm',
            '*.natvis',
            '*.ncl',
            '*.ndproj',
            '*.nproj',
            '*.nuspec',
            '*.odd',
            '*.osm',
            '*.pkgproj',
            '*.plist',
            '*.pluginspec',
            '*.proj',
            '*.props',
            '*.ps1xm',
            '*.psc1',
            '*.pt',
            '*.rdf',
            '*.resx',
            '*.rss',
            '*.sch',
            '*.scxml',
            '*.sfproj',
            '*.shproj',
            '*.srdf',
            '*.storyboard',
            '*.stTheme',
            '*.sublime-snippe',
            '*.targets',
            '*.tmCommand',
            '*.tml',
            '*.tmLanguage',
            '*.tmPreferences',
            '*.tmSnippet',
            '*.tmTheme',
            '*.ts',
            '*.tsx',
            '*.ui',
            '*.urdf',
            '*.u',
            '*.vbproj',
            '*.vcxproj',
            '*.vsixmanifest',
            '*.vssettings',
            '*.vstemplate',
            '*.vxml',
            '*.wixproj',
            '*.workflow',
            '*.wsdl',
            '*.wsf',
            '*.wxi',
            '*.wx',
            '*.wxs',
            '*.x3d',
            '*.xacro',
            '*.xaml',
            '*.xib',
            '*.xlf',
            '*.xliff',
            '*.xmi',
            '*.xml.dist',
            '*.xproj',
            '*.xsd',
            '*.xspec',
            '*.xul',
            '*.zcml',
        ],
        mimetypes: ['text/xml'],
    },
    XPages: {
        color: null,
        codeMirrorMode: 'xml',
        extensions: ['*.xsp-config', '*.xsp.metadata'],
        mimetypes: ['text/xml'],
    },
    XProc: {
        color: null,
        codeMirrorMode: 'xml',
        extensions: ['*.xpl', '*.xproc'],
        mimetypes: ['text/xml'],
    },
    XQuery: {
        color: '#5232e7',
        codeMirrorMode: 'xquery',
        extensions: ['*.xquery', '*.xq', '*.xql', '*.xqm', '*.xqy'],
        mimetypes: ['application/xquery'],
    },
    XS: {
        color: null,
        codeMirrorMode: 'clike',
        extensions: ['*.xs'],
        mimetypes: ['text/x-csrc'],
    },
    XSLT: {
        color: '#EB8CEB',
        codeMirrorMode: 'xml',
        extensions: ['*.xslt', '*.xsl'],
        mimetypes: ['text/xml'],
    },
    YAML: {
        color: null,
        codeMirrorMode: 'yml',
        extensions: [
            '*.yml',
            '*.mir',
            '*.reek',
            '*.rviz',
            '*.sublime-syntax',
            '*.syntax',
            '*.yaml',
            '*.yaml-tmlanguage',
            '*.yml.mysql',
        ],
        mimetypes: ['text/x-yaml'],
    },
}

const usedExtensions = [
    {
        origLangName: 'XML',
        name: 'XML',
        extensions: [
            'xml',
            'adml',
            'admx',
            'ant',
            'axml',
            'builds',
            'ccproj',
            'ccxml',
            'clixml',
            'cproject',
            'cscfg',
            'csdef',
            'cs',
            'csproj',
            'ct',
            'depproj',
            'dita',
            'ditamap',
            'ditaval',
            'dll.config',
            'dotsettings',
            'filters',
            'fsproj',
            'fxml',
            'glad',
            'gml',
            'gmx',
            'grxml',
            'iml',
            'ivy',
            'jelly',
            'jsproj',
            'kml',
            'launch',
            'mdpolicy',
            'mjml',
            'mm',
            'mod',
            'mxm',
            'natvis',
            'ncl',
            'ndproj',
            'nproj',
            'nuspec',
            'odd',
            'osm',
            'pkgproj',
            'plist',
            'pluginspec',
            'proj',
            'props',
            'ps1xm',
            'psc1',
            'pt',
            'rdf',
            'resx',
            'rss',
            'sch',
            'scxml',
            'sfproj',
            'shproj',
            'srdf',
            'storyboard',
            'stTheme',
            'sublime-snippe',
            'targets',
            'tmCommand',
            'tml',
            'tmLanguage',
            'tmPreferences',
            'tmSnippet',
            'tmTheme',
            'ts',
            'tsx',
            'ui',
            'urdf',
            'u',
            'vbproj',
            'vcxproj',
            'vsixmanifest',
            'vssettings',
            'vstemplate',
            'vxml',
            'wixproj',
            'workflow',
            'wsdl',
            'wsf',
            'wxi',
            'wx',
            'wxs',
            'x3d',
            'xacro',
            'xaml',
            'xib',
            'xlf',
            'xliff',
            'xmi',
            'xml.dist',
            'xproj',
            'xsd',
            'xspec',
            'xul',
            'zcml',
            // additions by aman
            'man',
            'StyleCop',
        ],
        exactMatches: [/^nuget.config$/],
    },
    {
        origLangName: 'JavaScript',
        name: 'SpecialJavascript',
        extensions: ['sve', 'svelte', 'vue'],
        exactMatches: [],
    },
    {
        origLangName: 'Python',
        name: 'Specialpython',
        extensions: ['pyi'],
        exactMatches: [],
    },
    {
        origLangName: 'TOML',
        name: 'Lock',
        extensions: ['lock'],
        exactMatches: [],
    },
]

export const syntaxBundle = async (filePath: string) => {
    if (!filePath) return []

    const fileName = filePath.split(connector.PLATFORM_DELIMITER).pop()!

    const fileExtension = fileName.split('.').pop()!
    const extensions = []
    // Find the language mode from the Codemirror language data
    const langPackage = languages.find(
        (lang) =>
            lang.extensions.includes(fileExtension) ||
            (lang.filename && fileName.match(lang.filename))
    )
    if (langPackage != null) {
        extensions.push(await langPackage.load())
    } else {
        // Otherwise, we  handle special cases
        const otherExtension = usedExtensions.find(
            (ext) =>
                ext.extensions.includes(fileExtension) ||
                ext.exactMatches.some((match) => fileName.match(match))
        )

        if (otherExtension != null) {
            const langPackage = languages.find((lang) =>
                lang.name.includes(otherExtension.origLangName)
            )
            if (langPackage != null) {
                extensions.push(await langPackage.load())
            }
        }
    }
    switch (fileExtension) {
        case 'css':
            return [colorPicker, ...extensions]
        default:
            return extensions
    }
}
